<?php
// -----------------------------------------------------------------------------
// include
// -----------------------------------------------------------------------------

include "../config/config.php";
include "../auth.php";

// -----------------------------------------------------------------------------
?>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>总结与规划</title>
    <link rel="stylesheet" href="../resources/bootstrap-5.2.0-beta1-dist/css/bootstrap.min.css">
</head>
<body>

<!-- ----------------------------------------------------------------------- -->

<script src="../resources/bootstrap-5.2.0-beta1-dist/js/bootstrap.min.js"></script>
<script src="../resources/jQuery/jquery-3.5.1.js"></script>
<?php include "../globalNavbar.php"; ?>

<!-- ----------------------------------------------------------------------- -->

<!-- div container start -->
<div class="container container-fluid mb-5">

    <!-- 导航栏 开始 -->
    <div class="mt-3">
        <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a class="text-decoration-none" href="<?php echo $homepage; ?>">首页</a></li>
                <li class="breadcrumb-item active">总结与规划</li>
            </ol>
        </nav>
    </div>
    <!-- 导航栏 结束 -->

    <div class="list-group mt-3">
        <a href="create.php" class="list-group-item list-group-item-action">新建「总结与规划」</a>
        <a href="listOfSummariesAndPlans.php?year=all&sort=timeEdit&sequence=desc" class="list-group-item list-group-item-action">所有「总结与规划」</a>
    </div>

    <div id="listOfYears" class="mt-2 mb-2">
    </div>

</div>
<!-- div container end -->

<!-- ----------------------------------------------------------------------- -->

<script>
    // 获取待办事务收纳箱列表
    function getListOfYears() {
        var url = "generateListOfYears.php";
        $.get(url)
            .done(function(data ) {
                $("#listOfYears").html(data)
            })
            .fail(function () {
                alert("获取年份列表失败。")
            });
    }

    // 网页加载完成后，自动生成总结与规划年份列表
    $(function () {
        getListOfYears()
    })
</script>

<!-- ----------------------------------------------------------------------- -->

<!-- 添加「返回顶部按钮」 -->
<script src="../resources/vanilla-back-to-top/index.js"></script>
<script src="../resources/vanilla-back-to-top/config.js"></script>

<!-- ----------------------------------------------------------------------- -->

</body>
</html>
